Add key bindings to make C-/ select all and C-\ unselect all. (#309301,
authorMatthias Clasen <mclasen@redhat.com>
Tue, 30 Aug 2005 18:38:17 +0000 (18:38 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 30 Aug 2005 18:38:17 +0000 (18:38 +0000)
2005-08-30  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkentry.c (gtk_entry_class_init): Add key bindings to
make C-/ select all and C-\ unselect all.  (#309301,
Kathy Fernandez)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkentry.c

index 80397d9ff67b5699018e307ab4e3132695e6ad63..22e618392f6b00a8eacd514a18793eb714633813 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-08-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkentry.c (gtk_entry_class_init): Add key bindings to
+       make C-/ select all and C-\ unselect all.  (#309301,
+       Kathy Fernandez)
+
        * gtk/gtkimcontextsimple.c: Change the compose sequence for
        soft hyphen to be multi_key-minus-minus-space, and add
        compose sequences multi_key-minus-minus-period and 
index 80397d9ff67b5699018e307ab4e3132695e6ad63..22e618392f6b00a8eacd514a18793eb714633813 100644 (file)
@@ -1,5 +1,9 @@
 2005-08-30  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkentry.c (gtk_entry_class_init): Add key bindings to
+       make C-/ select all and C-\ unselect all.  (#309301,
+       Kathy Fernandez)
+
        * gtk/gtkimcontextsimple.c: Change the compose sequence for
        soft hyphen to be multi_key-minus-minus-space, and add
        compose sequences multi_key-minus-minus-period and 
index c3d340aafeb0d22a3560212648450369d3317602..c4757c0d63d2b146f1d151ac3f3695029a0911c7 100644 (file)
@@ -763,8 +763,25 @@ gtk_entry_class_init (GtkEntryClass *class)
                                 "move_cursor", 3,
                                 GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS,
                                 G_TYPE_INT, 1,
-                               G_TYPE_BOOLEAN, TRUE);
+                               G_TYPE_BOOLEAN, TRUE);  
 
+  gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK,
+                                "move_cursor", 3,
+                                GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS,
+                                G_TYPE_INT, -1,
+                               G_TYPE_BOOLEAN, FALSE);
+  gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK,
+                                "move_cursor", 3,
+                                GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS,
+                                G_TYPE_INT, 1,
+                               G_TYPE_BOOLEAN, TRUE);  
+  /* Unselect all 
+   */
+  gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_CONTROL_MASK,
+                                "move_cursor", 3,
+                                GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_VISUAL_POSITIONS,
+                                G_TYPE_INT, 0,
+                               G_TYPE_BOOLEAN, FALSE);
 
   /* Activate
    */
@@ -1378,7 +1395,7 @@ gtk_entry_draw_frame (GtkWidget *widget)
       
       gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget), 
                       NULL, widget, "entry",
-                      x, y, width, height);
+                      0, 0, width, height);
     }
 }
 
@@ -2400,9 +2417,9 @@ gtk_entry_move_cursor (GtkEntry       *entry,
            gint current_x = get_better_cursor_x (entry, entry->current_pos);
            gint bound_x = get_better_cursor_x (entry, entry->selection_bound);
 
-           if (count < 0)
+           if (count <= 0)
              new_pos = current_x < bound_x ? entry->current_pos : entry->selection_bound;
-           else
+           else 
              new_pos = current_x > bound_x ? entry->current_pos : entry->selection_bound;
 
            break;